package com.hd.controller;

import com.hd.pojo.Case;
import com.hd.pojo.CaseIllnessRelation;
import com.hd.pojo.Illness;
import com.hd.service.CaseIllnessRelationService;
import com.hd.service.CaseService;
import com.hd.service.IllnessService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created by 1 on 2017/11/27.
 */
@RestController
@RequestMapping("/director/caseEnter")
public class CaseController {

    @Resource
    private CaseService caseService;

    private String msg;

    @PostMapping("/addCase")
    public String addCase(Case ca, String[] illnessName,String[] illnessResult){
        Integer i = caseService.addCase(ca,illnessName,illnessResult);
        if(i>0){
            msg = "添加成功!";
        }else{
            msg = "添加失败!";
        }
        return msg;
    }

}
